package xin.lhuo.we.server.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @author Lhuo
 * @date 2019/5/23 17:49
 */

@Getter
@Setter
@ToString
public class CaiYunWeather {
    private String status;
    private String lang;
    private ResultBean result;
    private int server_time;
    private String api_status;
    private int tzshift;
    private String api_version;
    private String timezone;
    private String unit;
    private List<Double> location;

    @Getter
    @Setter
    @ToString
    public static class ResultBean {
        private int primary;
        private DailyBean daily;

        @Getter
        @Setter
        @ToString
        public static class DailyBean {
            private String status;
            private AirQualityBean air_quality;
            private LifeIndexBean life_index;
            private List<Skycon20h32hBean> skycon_20h_32h;
            private List<TemperatureBean> temperature;
            private List<DswrfBean> dswrf;
            private List<CloudrateBean> cloudrate;
            private List<SkyconBean> skycon;
            private List<VisibilityBean> visibility;
            private List<HumidityBean> humidity;
            private List<AstroBean> astro;
            private List<PressureBean> pressure;
            private List<PrecipitationBean> precipitation;
            private List<WindBean> wind;
            private List<Skycon08h20hBean> skycon_08h_20h;


            @Getter
            @Setter
            @ToString
            public static class AirQualityBean {
                private List<AqiBean> aqi;
                private List<Pm25Bean> pm25;

                @Getter
                @Setter
                @ToString
                public static class AqiBean {
                    /**
                     * Aqi
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * max : {"usa":50,"chn":50}
                     * avg : {"usa":38,"chn":38}
                     * min : {"usa":26,"chn":26}
                     */

                    private String date;
                    private MaxBean max;
                    private AvgBean avg;
                    private MinBean min;

                    @Getter
                    @Setter
                    @ToString
                    public static class MaxBean {
                        private int usa;
                        private int chn;
                    }

                    @Getter
                    @Setter
                    @ToString
                    public static class AvgBean {
                        private double usa;
                        private double chn;
                    }

                    @Getter
                    @Setter
                    @ToString
                    public static class MinBean {
                        private int usa;
                        private int chn;
                    }
                }

                @Getter
                @Setter
                @ToString
                public static class Pm25Bean {
                    /**
                     * pm2.5
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * max : 15
                     * avg : 8.0
                     * min : 2
                     */

                    private String date;
                    private int max;
                    private double avg;
                    private int min;
                }
            }

            @Getter
            @Setter
            @ToString
            public static class LifeIndexBean {
                private List<ColdRiskBean> coldRisk;
                private List<CarWashingBean> carWashing;
                private List<UltravioletBean> ultraviolet;
                private List<ComfortBean> comfort;
                private List<DressingBean> dressing;

                @Getter
                @Setter
                @ToString
                public static class ColdRiskBean {
                    /**
                     * 感冒
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * index : 3
                     * desc : 易发
                     */

                    private String date;
                    private String index;
                    private String desc;
                }

                @Getter
                @Setter
                @ToString
                public static class CarWashingBean {
                    /**
                     * 洗车
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * index : 1
                     * desc : 适宜
                     */

                    private String date;
                    private String index;
                    private String desc;
                }

                @Getter
                @Setter
                @ToString
                public static class UltravioletBean {
                    /**
                     * 紫外线
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * index : 1
                     * desc : 最弱
                     */

                    private String date;
                    private String index;
                    private String desc;
                }

                @Getter
                @Setter
                @ToString
                public static class ComfortBean {
                    /**
                     * 舒适度
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * index : 3
                     * desc : 热
                     */

                    private String date;
                    private String index;
                    private String desc;
                }

                @Getter
                @Setter
                @ToString
                public static class DressingBean {
                    /**
                     * 穿衣指数
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * index : 3
                     * desc : 热
                     */

                    private String date;
                    private String index;
                    private String desc;
                }
            }

            @Getter
            @Setter
            @ToString
            public static class Skycon20h32hBean {
                /**
                 * 夜晚主要天气现象
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * value : CLEAR_NIGHT
                 */
                private String date;
                private String value;

            }

            @Getter
            @Setter
            @ToString
            public static class TemperatureBean {
                /**
                 * 温度
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 25.0
                 * avg : 22.83
                 * min : 21.0
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }


            @Getter
            @Setter
            @ToString
            public static class DswrfBean {
                /**
                 * 短波辐射
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 407.6
                 * avg : 0.0
                 * min : 0.0
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class CloudrateBean {
                /**
                 * 云量
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 0.99
                 * avg : 0.2
                 * min : 0.1
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class SkyconBean {
                /**
                 * 全天主要天气现象
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * value : CLEAR_NIGHT
                 */

                private String date;
                private String value;
            }

            @Getter
            @Setter
            @ToString
            public static class VisibilityBean {
                /**
                 * 能见度
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 23.37
                 * avg : 18.52
                 * min : 9.58
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class HumidityBean {
                /**
                 * 相对湿度
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 0.82
                 * avg : 0.81
                 * min : 0.68
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class AstroBean {
                /**
                 * 日出日落
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * sunset : {"time":"18:34"}
                 * sunrise : {"time":"05:05"}
                 */

                private String date;
                private SunsetBean sunset;
                private SunriseBean sunrise;

                @Getter
                @Setter
                @ToString
                public static class SunsetBean {
                    private String time;
                }

                @Getter
                @Setter
                @ToString
                public static class SunriseBean {
                    private String time;

                    public String getTime() {
                        return time;
                    }

                    public void setTime(String time) {
                        this.time = time;
                    }
                }
            }

            @Getter
            @Setter
            @ToString
            public static class PressureBean {
                /**
                 * 气压
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 99849.19
                 * avg : 99787.93
                 * min : 99540.79
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class PrecipitationBean {
                /**
                 * 本地降水强度
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 1.0277
                 * avg : 0.0
                 * min : 0.0
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }

            @Getter
            @Setter
            @ToString
            public static class WindBean {
                /**
                 * 风速
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : {"direction":117.39,"speed":18.21}
                 * avg : {"direction":104.25,"speed":11.19}
                 * min : {"direction":141.51,"speed":1.87}
                 */

                private String date;
                private MaxBeanX max;
                private AvgBeanX avg;
                private MinBeanX min;

                @Getter
                @Setter
                @ToString
                public static class MaxBeanX {
                    private double direction;
                    private double speed;
                }

                @Getter
                @Setter
                @ToString
                public static class AvgBeanX {
                    private double direction;
                    private double speed;
                }

                @Getter
                @Setter
                @ToString
                public static class MinBeanX {
                    private double direction;
                    private double speed;
                }
            }

            @Getter
            @Setter
            @ToString
            public static class Skycon08h20hBean {
                /**
                 * 夜晚主要天气现象
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * value : LIGHT_RAIN
                 */

                private String date;
                private String value;
            }
        }
    }
}
